#pragma once
#include "level.hpp"
#include "util.hpp"
#include <iostream>
#include <string>
#include <thread>

namespace log
{
    struct LogMsg
    {
        size_t _line; //行号
        time_t _time; //时间
        std::thread::id _tid; //线程id
        std::string _name; //日志器名称
        std::string _file; //源文件名
        std::string _payload; //日志有效消息
        Level _level; //日志等级

        LogMsg(size_t line, std::string name, std::string file, std::string payload, Level level)
            : _line(line),
              _time(Date::curTime()),
              _tid(std::this_thread::get_id()),
              _name(name),
              _file(file),
              _payload(payload),
              _level(level)
        {}
    };
};